package ipad.asia.service.admin;

import ipad.asia.entity.Admin;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.IOException;

@Component
@FeignClient(value = "PROVIDER-ADMIN")
public interface AdminFeign {
    /**
     * 管理员登录
     */
    @RequestMapping("/admin/login")
     boolean login(@RequestParam(value = "user",required = false) String user,
                   @RequestParam(value = "password", required = false) String password) ;
    /**
     * 注册
     * @param user
     * @param password
     * @param email
     * @param phone
     * @return
     */
    @PostMapping("/admin/register")
     boolean register(@RequestParam(value = "user") String user,
                            @RequestParam(value = "password") String password,
                            @RequestParam(value = "email",required = false) String email,
                            @RequestParam(value = "phone",required = false) Integer phone) ;
    /**
     * 查找id，用作session
     * @param id
     * @return
     */
    @RequestMapping("/admin/get")
     Admin get(@RequestParam("id") int id) ;
}
